package org.kazuhiko.rpg.display.menu;

import static org.lwjgl.opengl.GL11.GL_QUADS;
import static org.lwjgl.opengl.GL11.glBegin;
import static org.lwjgl.opengl.GL11.glColor4f;
import static org.lwjgl.opengl.GL11.glEnd;
import static org.lwjgl.opengl.GL11.glVertex2f;

import org.kazuhiko.rpg.core.menu.Menu;
import org.kazuhiko.rpg.core.menu.MenuItem;

public class MainMenu extends Menu
{
	public MainMenu()
	{
		super();
	}
	
	@Override
	public void render()
	{
		//Drawing the background
		glBegin( GL_QUADS );
		{
			glColor4f( getR(), getG(), getB(), getA() );
			
			glVertex2f( getX(), getY() );
			glVertex2f( getX(), getY() + getHeight() );
			glVertex2f( getX() + getWidth(), getY() + getHeight() );
			glVertex2f( getX() + getWidth(), getY() );
		}
		glEnd();
		
		for( MenuItem item : getItems() )
		{
			item.render();
		}
	}
}
